package ants.map;

public class CoordinateFactory {

  private Coordinate[][] coordinatePool;

  public CoordinateFactory(int rows, int cols) {
    coordinatePool = new Coordinate[rows][cols];
    for (int row = 0; row < rows; row++) {
      for (int col = 0; col < cols; col++) {
        coordinatePool[row][col] = new Coordinate(row, col);
      }
    }
  }

  public Coordinate getCoordinate(int row, int col) {
    return coordinatePool[row][col];
  }

}
